<?php

	$Transaction_Queries = array();
	
#3
	$Transaction_Queries['ABONENT_CHANGES'] = null;

	$Transaction_Queries['TRANSACT_GETFEES'] = null;

	$Transaction_Queries['TRANSACT_OUTGOING'] = "SELECT FraID,
		FraOrigen0,
		CliApellidos,
		CliFechaNacimiento,
		CLPais,
		CliProvincia,
		CliTipoDoc AS CliDNIType,
		'' AS CliDNIStatus,
		'' AS CliDNIIssued,
		'' AS CliDNIValidDate,
		CliRes1 AS CliNaturalidad,
		BnfApellidos,
		BnfBarrio,
		BnfDocType,
		FraClave,
		CONCAT(FraOrigen0,'-',LPAD(FraReferenciaAg,6,0)) AS ORInternal,
		date_format(FraFecha, '%m/%d/%Y') AS FraFecha,
		date_format(FraFecha, '%Y%m%d') AS FraFecha2,
		date_format(FraFecha, '%Y-%m-%d') AS FraFecha3,
		date_format(FraFecha, '%h:%i:%s') AS FraHora,
		FraReferenciaAg,
		FraReferenciaCo,
		FraComisionCorr,
		FraTasa,
		FraMensaje,
		FraStatus,
		FraNotas,
		BnfCedula,
		BnfNombre,
		BnfTelefono,
		BnfBarrio,
		BnfDireccion,
		BnfProvincia,
		BnfTelefono,
		BnfTelefono2,
		ciudades.CiuCiudad AS BnfCiudad,
		hd_paises.pai_NombreUSD AS BnfPais,
		hd_paises.pai_Sufijo AS BnfPaisCode,
		hd_paises.pai_CodeIso AS BnfPaisISONum,
		bp_IdBanco,
		cb_Banco,
		cb_Sucursal,
		cb_Cuenta,
		cb_Cuenta_prx,
		cb_Cuenta_sux,
		cb_Cuenta_mod,
		cb_TipoCuenta,
		CorrNumero,
		CorrAgente,
		hf_actypes.SHORT_NAME AS TipoCuenta,
		CliNombre,
		CliDNI,
		CliDomicilio,
		CliCP,
		CliTelefono,
		cl_country.pai_NombreESP AS CliPais,
		cl_country.pai_Sufijo AS CliPaisCode,
		cl_country.pai_CodeIso AS CliPaisISONum,
		cl_city.CiuCiudad AS CliCiudad,
		ROUND(FraEnviado) AS FraEnviado,
		ROUND(FraARecibir,0) AS FraARecibir,
		CobMon.miso_ID AS FraMonCobro,
		PagMon.miso_ID AS FraMonDPago,
		bp_Name,
		tcn_Short AS FraModo,
		OFCorrCode AS FraAgenciaPago,
		mp_short AS FraModoPago
	FROM facturas IGNORE INDEX (IdxCli)
	INNER JOIN clientes ON CliNumero = FraCliNumero
	INNER JOIN beneficiarios ON BnfNumero = FraBnfNumero
	INNER JOIN corresponsales ON CorrNumero = FraCorresponsal
	INNER JOIN hd_transactionconcept ON tcn_ID = FraModo
	LEFT OUTER JOIN ciudades ON CiuNumero = BnfCiudad
	LEFT OUTER JOIN ciudades AS cl_city		ON cl_city.CiuNumero = CliCiudad
	INNER JOIN hd_paises ON pai_CodElite = BnfPais
	INNER JOIN hd_paises AS cl_country	ON cl_country.pai_CodElite = ClPais
	INNER JOIN hd_monedasiso AS CobMon ON CobMon.miso_cod_elite = FraMonCobro
	INNER JOIN hd_monedasiso AS PagMon ON PagMon.miso_cod_elite = FraMonDPago
	INNER JOIN hd_modospago ON mp_ID = FraModoPago
	LEFT OUTER JOIN beneficiarioscuentas ON cb_Id = FraCtaBenef
	LEFT OUTER JOIN hf_actypes ON hf_actypes.REF = cb_TipoCuenta
	LEFT OUTER JOIN hd_bancos ON bp_ID = cb_Banco
	LEFT OUTER JOIN oficcorresp ON OFId = FraAgenciaPago
	WHERE FraOrdenTrans = #@TRANSACTVALUE@# AND FraCorresponsal = #@TRANSACTCORR@#
	AND FraStatus = 7";
	
	$Transaction_Queries['TRANSACT_OUTGOINGANDPAY'] = $Transaction_Queries['TRANSACT_OUTGOING'];

#4	Get
	$Transaction_Queries['TRANSACT_GETLISTOFORDERSSENT'] = null;
#5			
	$Transaction_Queries['TrnChange'] = "SELECT * FROM facturas WHERE FraOrdenPago = ";
#6
	$Transaction_Queries['TrnInfo'] = "SELECT * FROM facturas WHERE FraOrdenPago = ";
#7	
	$Transaction_Queries['TrnCancelReq'] = "SELECT * FROM facturas WHERE FraOrdenPago = ";
#8
	$Transaction_Queries['TrnGetOrders_Get'] = "SELECT * FROM facturas WHERE FraOrdenPago = ";
#9
	$Transaction_Queries['TrnMessageGot'] = "SELECT * FROM facturas WHERE FraOrdenPago = ";
	
	# Transaction Response
	#$Rsp 	= array('trnID','trnResponseCode');
#10			
	$Transaction_Queries['TrnGetOrders_ToPayout'] = null;
#11			
	$Transaction_Queries['TrnGetOrders_Paid'] = "SELECT * FROM facturas WHERE FraOrdenPago = ";
#12			
	$Transaction_Queries['TrnGetOrders_ToReturn'] = "SELECT * FROM facturas WHERE FraOrdenPago = ";
#13			
	$Transaction_Queries['TrnGetOrders_Cancelled'] = "SELECT * FROM facturas WHERE FraOrdenPago = ";
#14			
	$Transaction_Queries['TrnPayOrder'] = "SELECT * FROM facturas WHERE FraOrdenPago = ";
#15	
	$Transaction_Queries['TrnReturnOrder'] = "SELECT * FROM facturas WHERE FraOrdenPago = ";
#16			
	$Transaction_Queries['TrnPayReverse'] = "SELECT * FROM facturas WHERE FraOrdenPago = ";
#17	- With Response		
	$Transaction_Queries['TrnPayCheck'] = "SELECT * FROM facturas WHERE FraOrdenPago = ";
#18	- With Response		
	$Transaction_Queries['TrnExchange'] = "SELECT * FROM facturas WHERE FraOrdenPago = ";
#19	- With Response		
	$Transaction_Queries['TrnCalcFees'] = "SELECT * FROM facturas WHERE FraOrdenPago = ";
#20	- With Response		
	$Transaction_Queries['TrnGetRecCountries'] = "SELECT * FROM facturas WHERE FraOrdenPago = ";
			
#21	- With Response		
	$Transaction_Queries['TrnGetRecRegions'] = "SELECT * FROM facturas WHERE FraOrdenPago = ";
#22	- With Response		
	$Transaction_Queries['TrnGetRecCities'] = "SELECT * FROM facturas WHERE FraOrdenPago = ";
#23	- With Response		
	$Transaction_Queries['TrnGetRecPoints'] = "SELECT * FROM facturas WHERE FraOrdenPago = ";
#24	- With Response		
	$Transaction_Queries['TRANSACT_GETRECAGENTS'] = null;
#25	- With Response		
	$Transaction_Queries['TrnPayerTemplates'] = "SELECT * FROM facturas WHERE FraOrdenPago = ";
#26	- With Response		
	$Transaction_Queries['TrnRefData_GetChanges'] = "SELECT * FROM facturas WHERE FraOrdenPago = ";
#27			
	$Transaction_Queries['TrnReject'] = "SELECT * FROM facturas WHERE FraOrdenPago = ";
#28			
	$Transaction_Queries['TrnOrderGot'] = "SELECT * FROM facturas WHERE FraOrdenPago = ";
	
	